<div class="row-content layer-cf">
    <div class="row">
        <div class="layer-u-sm-12 layer-u-md-12 layer-u-lg-12">
            <div class="widget layer-cf">
                <form id="my-form" class="layer-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head layer-cf">
                                <div class="widget-title layer-fl">商品评价详情</div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label">用户 </label>
                                <div class="layer-u-sm-9 layer-u-end layer-padding-top-xs">
                                    <small class="layer-text-sm">{$model['user']['nickName']}</small>
                                    <small class="">(用户id：{$model['user']['user_id']})</small>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label">商品图片 </label>
                                <div class="layer-u-sm-9 layer-u-end">
                                    <a href="{$model['order_list']['image']['file_path']}"
                                       title="点击查看大图" target="_blank">
                                        <img src="{$model['order_list']['image']['file_path']}" alt="商品图片"
                                             width="80" height="80">
                                    </a>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label">商品名称 </label>
                                <div class="layer-u-sm-9 layer-u-end layer-padding-top-xs">
                                    <small class="layer-text-sm">{$model['order_list']['name']}</small>
                                </div>
                            </div>
                            <div class="layer-form-group layer-margin-top-xl">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label form-require">评分 </label>
                                <div class="layer-u-sm-9 layer-u-end">
                                    <label class="layer-radio-inline">
                                        <input type="radio" name="comment[score]" value="10" data-am-ucheck
                                            {$model['score'] === 10 ? 'checked' : ''} >
                                        好评
                                    </label>
                                    <label class="layer-radio-inline">
                                        <input type="radio" name="comment[score]" value="20" data-am-ucheck
                                            {$model['score'] === 20 ? 'checked' : ''} >
                                        中评
                                    </label>
                                    <label class="layer-radio-inline">
                                        <input type="radio" name="comment[score]" value="30" data-am-ucheck
                                            {$model['score'] === 30 ? 'checked' : ''} >
                                        差评
                                    </label>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label form-require">评价内容 </label>
                                <div class="layer-u-sm-9 layer-u-end layer-padding-top-xs">
                                    <textarea class="layer-field-valid" rows="5" placeholder="请输入评价内容"
                                              name="comment[content]" required>{$model['content']}</textarea>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label">评价图片 </label>
                                <div class="layer-u-sm-9 layer-u-end">
                                    <div class="layer-form-file">
                                        <button type="button" class="upload-file layer-btn layer-btn-secondary layer-radius">
                                            <i class="layer-icon-cloud-upload"></i> 选择图片
                                        </button>
                                        <div class="uploader-list layer-cf">
										{if isset($model['image'])}
										
                                            {foreach $model['image'] as $key => $item}
                                                <div class="file-item">
                                                    <a href="{$item['file_path']}" title="点击查看大图" target="_blank">
                                                        <img src="{$item['file_path']}">
                                                    </a>
                                                    <input type="hidden" name="comment[images][]"
                                                           value="{$item['image_id']}">
                                                    <i class="iconfont icon-shanchu file-item-delete"></i>
                                                </div>
                                            {/foreach}
										{/if}
                                        </div>
                                    </div>
                                    <div class="help-block layer-margin-top-sm">
                                        <small>最多允许6张，可拖拽调整显示顺序</small>
                                    </div>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label form-require">评价排序 </label>
                                <div class="layer-u-sm-9 layer-u-end">
                                    <input type="number" min="0" class="tpl-form-input" name="comment[sort]"
                                           value="{$model['sort']}" required>
                                    <small>数字越小越靠前</small>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label form-require">显示状态 </label>
                                <div class="layer-u-sm-9 layer-u-end">
                                    <label class="layer-radio-inline">
                                        <input type="radio" name="comment[status]" value="0" data-am-ucheck
                                            {$model['status'] === 1 ? 'checked' : ''}>
                                        显示
                                    </label>
                                    <label class="layer-radio-inline">
                                        <input type="radio" name="comment[status]" value="1" data-am-ucheck
                                            {$model['status'] === 0 ? 'checked' : ''} >
                                        隐藏
                                    </label>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <label class="layer-u-sm-3 layer-u-lg-2 layer-form-label">评论时间 </label>
                                <div class="layer-u-sm-9 layer-u-end layer-padding-top-xs">
                                    <small class="layer-text-sm">{$model['create_time']}</small>
                                </div>
                            </div>
                            <div class="layer-form-group">
                                <div class="layer-u-sm-9 layer-u-sm-push-3 layer-margin-top-lg">
                                    <button type="submit" class="j-submit layer-btn layer-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 图片文件列表模板 -->
{include file="layouts/_template/tpl_file_item" /}

<!-- 文件库弹窗 -->
{include file="layouts/_template/file_library" /}

<script src="/assets/user/js/ddsort.js"></script>
<script>
    $(function () {

        // 选择图片
        $('.upload-file').selectImages({
            name: 'comment[images][]'
            , multiple: true
            , limit: 6
        });

        // 图片列表拖动
        $('.uploader-list').DDSort({
            target: '.file-item',
            delay: 100, // 延时处理，默认为 50 ms，防止手抖点击 A 链接无效
            floatStyle: {
                'border': '1px solid #ccc',
                'background-color': '#fff'
            }
        });

        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();

    });
</script>
